﻿namespace TDMS.Net;

public static class TdmsObjectExtensions
{
    public static TdmsProperty CreateProperty(this TdmsObject tdms, string property, byte value)
        => tdms.CreateProperty(property, ETdmsPropertyDataType.UInt8, value);

    public static TdmsProperty CreateProperty(this TdmsObject tdms, string property, int value)
        => tdms.CreateProperty(property, ETdmsPropertyDataType.Int32, value);

    public static TdmsProperty CreateProperty(this TdmsObject tdms, string property, float value)
        => tdms.CreateProperty(property, ETdmsPropertyDataType.Float, value);

    public static TdmsProperty CreateProperty(this TdmsObject tdms, string property, double value)
        => tdms.CreateProperty(property, ETdmsPropertyDataType.Double, value);

    public static TdmsProperty CreateProperty(this TdmsObject tdms, string property, string value)
        => tdms.CreateProperty(property, ETdmsPropertyDataType.String, value);

    public static TdmsProperty CreateProperty(this TdmsObject tdms, string property, DateTime value)
        => tdms.CreateProperty(property, ETdmsPropertyDataType.DateTime, value);
}